extends State
class_name Playerwalljump
var wall_force:float = 200.0
@export var xVelocity:float = 100.0
@export var yVelocity:float = 420.0

func enter():
	var wall_direction = character.get_wall_normal().x
	Autoload.lock_time = 0.16
	if(wall_direction > 0):
		character.velocity.x = xVelocity
	else:
		character.velocity.x = -xVelocity
	character.velocity.y = -yVelocity
	
func update(delta):
	Autoload.lock_time -= delta
	Autoload.wolf_time -= delta
	if Autoload.lock_time < 0:
		transition_requested.emit("Playerjump")
	
	
func physics_update(delta):
	character.velocity.y += Autoload.gravity * delta
	character.move_and_slide()


func _on_x速度变大_button_down() -> void:
	xVelocity += 10.0
	pass # Replace with function body.


func _on_x速度变小_button_down() -> void:
	xVelocity -= 10.0
	pass # Replace with function body.


func _on_y速度变大_button_down() -> void:
	yVelocity += 10.0
	pass # Replace with function body.


func _on_y速度变小_button_down() -> void:
	yVelocity -= 10.0
	pass # Replace with function body.
